var e = require("../../../../@babel/runtime/helpers/defineProperty"), t = getApp();

Page({
    data: {
        nums: "",
        active_forze_love: "",
        active_forze_nums: "",
        active_forze_point: "",
        active_forze_times: "",
        froze: "",
        point: "0.00",
        froze_name: "",
        pointKey: ""
    },
    onLoad: function(e) {
        this.getData(), e.froze_name && e.pointKey && this.setData({
            froze_name: e.froze_name,
            pointKey: e.pointKey
        }), wx.setNavigationBarTitle({
            title: e.froze_name + "激活"
        });
    },
    getData: function() {
        var e = this, o = t.getNetAddresss("plugin.love.Frontend.Modules.Love.Controllers.active-froze.index");
        t._getNetWork({
            url: o,
            success: function(t) {
                var o = t.data;
                1 == o.result && e.setData({
                    active_forze_love: o.data.active_forze_love,
                    active_forze_nums: o.data.active_forze_nums,
                    active_forze_point: o.data.active_forze_point,
                    active_forze_times: o.data.active_forze_times,
                    froze: o.data.froze
                });
            }
        });
    },
    activeLoveFroze: function() {
        var o = t.getNetAddresss("plugin.love.Frontend.Modules.Love.Controllers.active-froze.active");
        t._getNetWork({
            url: o,
            data: {
                nums: this.data.nums
            },
            success: function(t) {
                var o = t.data;
                o.result ? wx.showToast(e({
                    title: o.msg,
                    icon: "none"
                }, "icon", "success")) : wx.showToast(e({
                    title: o.msg,
                    icon: "none"
                }, "icon", "fail"));
            }
        });
    },
    onChange: function(e) {
        var t = Number(this.data.active_forze_point) / Number(this.data.active_forze_love);
        this.setData({
            nums: e.detail,
            point: (Number(e.detail) * t).toFixed(2)
        });
    }
});